package com.easyjf;

import org.springframework.beans.factory.BeanFactory;

import org.springframework.beans.factory.xml.XmlBeanFactory;

import org.springframework.core.io.ClassPathResource;

import org.springframework.core.io.Resource;

public class Hello {

       private String  msg;

       public void setMsg(String msg)

       {

              this.msg=msg;

       }

       public void sayHello()

       {

              System.out.print(msg);

       }     

       

       public static void main(String[] args) {

              Resource res=new ClassPathResource("com/easyjf/bean.xml");

              BeanFactory factory=new XmlBeanFactory(res);

              Hello hello=(Hello)factory.getBean("helloBean");

              hello.sayHello();

       }
}
